Dynomotion

Group: DynoMotion Message: 8845 From: tapiolarikka Date: 1/2/2014
Subject: Mach Dro's to KFlop
Hi Tom!

I tried the Mach Dro passing example but I don't get any response from it.

The basic NotifyMach.c works.

Should the example work with KMotion4.28

Seasons Greetings,
Tapio
Group: DynoMotion Message: 8846 From: Tom Kerekes Date: 1/2/2014
Subject: Re: Mach Dro's to KFlop
Hi Tapio,

I wish you would use a more recent Version.  But I believe Passing DROs was added before V4.28.

Regards
TK


Group: DynoMotion Message: 8848 From: Tapio Larikka Date: 1/3/2014
Subject: Re: Mach Dro's to KFlop

Hi Tom!
 
I'll upgrade to V430 and try if that makes a change.
 
After my posting I started to think that instead of passing parameters from a Mach vb script and having NotifyMach.c  doing things with these
why not have the vb script rewrite the whole NotifyMach.c to suit need and the parameters at hand?
 
I'll need the script anyway since for this application it is needed for G-code generation so there would not be much extra work in that.
 
I've noticed that execution of c-programs creates .out files. Should this be deleted before creating a new .c file?
 
Can you think of any drawbacks (other than not being as elegant as passing the parameters) with above approach?
 
Rgds,
Tapio 
 
 
----- Original Message -----
Sent: Thursday, January 02, 2014 11:51 PM
Subject: Re: [DynoMotion] Mach Dro's to KFlop

 

Hi Tapio,

I wish you would use a more recent Version.  But I believe Passing DROs was added before V4.28.

Regards
TK


Group: DynoMotion Message: 8849 From: Tom Kerekes Date: 1/3/2014
Subject: Re: Mach Dro's to KFlop
Hi Tapio,

If you post your code or what your results are we might be able to spot an error

But yes, making a dynamic NotifyPlugins.c should work.

The .out files are the compiled binary that is downloaded to KFLOP for execution.  There is no need to delete them as they will be automatically overwritten.  But you can if you wish.

Regards
TK


Group: DynoMotion Message: 8857 From: tapiolarikka Date: 1/4/2014
Subject: Re: Mach Dro's to KFlop
Hi Tom!

I upgraded to KMotion430

I copied the dro passing examples as they are. The Mach side to my screen button and the Kflop side to my
NotifyMach.c. The NotifyPlugins(19007) does not bring any response to KMotion console.

Where is the KFlop side of the code supposed to be? In NotifyMach.c or in Init.C?

The dynamic NotifyMach.c seems to take a bit more investigation since both Mach script compiler and VB.Net get confused by consecutive quotation marks: trying to print "#include "KMotionDef.h"" to a text file causes compiler error in both.

Rgds,
Tapio
Group: DynoMotion Message: 8858 From: Tom Kerekes Date: 1/4/2014
Subject: Re: Mach Dro's to KFlop
Hi Tapio,

The NotifyPlugins(19007) will not print anything on the console.  It will just put data into a pair of KFLOP persist variables (12 and 13).  You could use Console Commands GetPersistDec commands to verify they changed (but realize that a 64-bit floating point number is hard to understand displayed as 3 32-bit integers).  You don't need any C code on KFLOP at all for this to occur. 

The example shows some C code that you might have running in some unused Thread that just packs the pair of variables back into a floating point double and prints it on the console every 2 seconds.  This is all just for demo purposes.  It also does some simple math on the number (adds 999) and stores the result into another pair of variables in order to have something to test uploading.

In Basic to add a quote inside a string a double quote is usually used to tell the basic compiler you want to add a quote and not end the string.  I haven't tried this in Mach3 Basic.

HTH
Regards
TK